﻿using Game;

namespace Mekiasm
{
    public class MekBlockIconWidget : BlockIconWidget
    {        
        public MekBlockIconWidget() : base()
        {

        }

        public override void Update()
        {
            base.Update();
            if (Input.MousePosition.HasValue && HitTest(Input.MousePosition.Value))
            {
                var block = BlocksManager.Blocks[Terrain.ExtractContents(Value)];
                MekModLoader.DropBox(this, $"Block:{block.GetType().FullName}\nName:{block.GetDisplayName(null, Value)}\nID:{block.BlockIndex}\nCraftID:{ILibrary.GetCraftId(Value)}");

                if (Input.IsMouseButtonDown(Engine.Input.MouseButton.Right))
                {
                    ClipboardManager.ClipboardString = ILibrary.GetCraftId(Value);
                }
            }
        }
    }
}
